<?php ob_start();
include("../config/config.php"); 
if(!isset($_SESSION['csr_id'])){ header("location:index.php"); exit;}
$obj= new mycity();
if(isset($_REQUEST['status'])&&($_REQUEST['status']!="")){
	$status=$obj->change_status('my_business_url',$_REQUEST['id'],$_REQUEST['status']);
	if($status==1){
		
		echo "<script> alert('Page Aproved Suscessfully!!'); </script>";
			
	}else{echo "<script> alert('Page Rejected Suscessfully!!'); </script>";}
	header("location:inactive-pages.php"); exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Inactive Pages</title>
<style>
*{ margin:0px; padding:0px;}
</style>
</head>

<body>
<?php
if(isset($_SESSION['msg'])){
?>
<div style="color:red; text-align:center; font-size:16px;"><?php echo $_SESSION['msg']; unset($_SESSION['msg']); ?></div>
<?php }?>
<?php $sql=mysql_query("SELECT * FROM `my_business_url` WHERE `status` = 0 ORDER BY `id` ASC ")or die(mysql_error()); $row=mysql_fetch_array($sql);?>
<table width="100%" height="62" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <th width="6%" bgcolor="#009933" scope="col"> <a href="logout.php">Logout</a></th>
    <th width="6%" bgcolor="#009933" scope="col"><a href="emailer.php">Emailer</a></th>
    <th width="13%" bgcolor="#009933" scope="col">Inactive Pages ( <?php echo $obj->count_rowall("SELECT * FROM `my_business_url` WHERE `status` = 0 "); ?> )</th>
    <th width="53%" bgcolor="#009933" scope="col"><?php if(!empty($row['url'])){ echo "http://mycitydial.com/".$row['url']; } ?></th>
    <th width="12%" bgcolor="#009933" scope="col"><a href="?id=<?php echo $row['id']; ?>&status=1">Aprove</a></th>
    <th width="10%" bgcolor="#009933" scope="col"><a href="?id=<?php echo $row['id']; ?>&status=2">Reject</a></th>
  </tr>
</table>
<?php if(mysql_num_rows($sql)){?>
<iframe style="width:100%; min-height:2000px; overflow:hidden;" scrolling="no" src="http://mycitydial.com/<?php echo $row['url']; ?>"></iframe>
<?php }else{?>
<h1 align="center">No more page for Aprovel!</h1>
<?php }?>
</body>
</html>